#ifndef __6A8002CD_5650_4187_8CC9_66DCBF9501AF__
#define __6A8002CD_5650_4187_8CC9_66DCBF9501AF__

#include "../import/head.h"
#include "../tools/head.h"

/////////////////////////////////////////////////////////////////////////////////////////
// 

namespace xos
{
    // 
    // event_impl
    // 
    class event_impl : public xos_stl::mem_pool_item< event_impl, thread_lock >,
        public i_event
    {
    public:
        event_impl();
        ~event_impl();

    protected:
        pthread_mutex_t	m_mutex;
		pthread_cond_t	m_cond;
        bool m_bInit;

        bool m_bManuReset;
        bool m_bSignal;

    public:
        int init();
        int term();

    public:
        // 
        // wait for event ...
        // 
        unsigned long wait( unsigned long ulMilliseconds );

        // 
        // set event type.
        // 
        int set_event_type( bool bManuleReset );

        // 
        // reset event
        // 
        int reset_event();

        // 
        // set event
        // 
        int set_event();

        // 
        // release
        // 
        int release();
    };
} // xos

#endif // __6A8002CD_5650_4187_8CC9_66DCBF9501AF__
